//
//  LoginSheetView.swift
//  WanAndroidLearn
//
//  Created by TRS-Mobile on 2023/11/7.
//

import UIKit
import SnapKit
import RxTheme
import RxSwift
import RxCocoa

class LoginSheetView: UIBaseView {

    lazy var usernameTF: TextField = {
        let tf = TextField().then {
            $0.placeholder = "请输入用户名"
            $0.borderStyle = .roundedRect
        }
        return tf
    }()
    
    lazy var passwordTF: TextField = {
        let tf = TextField().then {
            $0.placeholder = "请输入密码"
            $0.borderStyle = .roundedRect
            $0.isSecureTextEntry = true
//            $0.isHidden = true
        }
        return tf
    }()
    
    lazy var closeBt: UIButton = {
        let bt = UIButton(type: .custom).then {
            $0.setImage(R.image.icon_common_close(), for: .normal)
            $0.layerCornerRadius = 14
        }
        return bt
    }()
    
    lazy var titleLabel: Label = {
        let le = Label().then {
            $0.font = .boldSystemFont(ofSize: 25)
            $0.text = "登录 玩❤️"
            $0.theme.textColor = themed { $0.text }
        }
        return le
    }()
    
    
    override func makeUI() {
        super.makeUI()
        addSubviews([titleLabel ,closeBt, usernameTF, passwordTF])
        
        closeBt.snp.makeConstraints { make in
            make.top.right.equalToSuperview().inset(12)
            make.size.equalTo(CGSize(width: 28, height: 28))
        }
        
        titleLabel.snp.makeConstraints { make in
            make.centerY.equalTo(closeBt)
            make.left.equalToSuperview().inset(12)
        }
        
        usernameTF.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.width.equalTo(200)
            make.top.equalTo(titleLabel.snp.bottom).offset(20)
        }
        passwordTF.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.width.equalTo(200)
            make.top.equalTo(usernameTF.snp.bottom).offset(15)
        }
        
        layerCornerRadius = 10
    }

}
